
********************************************************************************
***Summary statistics: Prevalence of 2-member households

eststo a: quietly estpost tabulate alwaysin2memberhh if edate_id==1335
esttab a using "Tables/SummaryHouseholds1.tex", replace ///
collabels( \multicolumn{1}{c}{{\#Individuals}} \multicolumn{1}{c}{{Percent}} \multicolumn{1}{l}{{Cumulative}}) ///
cells("b(label(Mean) fmt(%15.0fc)) pct(label(Percent) fmt(%15.2fc)) cumpct(label(Cumulative) fmt(%15.2fc))") ///
varlabel(0 "Never linked" 1 "Always linked") ///
nonumber nomtitle noobs nostar 

gen y = 1 if alwaysin2memberhh ==1 & hh_edate_obs == 1 & edate_id == 1335
replace  y = 0 if alwaysin2memberhh ==0 & edate_id == 1335
eststo a: estpost tabulate y
esttab a using "Tables/SummaryHouseholds2.tex", replace ///
collabels( \multicolumn{1}{c}{{\#Observations}} \multicolumn{1}{c}{{Percent}} \multicolumn{1}{l}{{Cumulative}}) ///
cells("b(label(Mean) fmt(%15.0fc)) pct(label(Percent) fmt(%15.2fc)) cumpct(label(Cumulative) fmt(%15.2fc))") ///
varlabel(0 "1-member households" 1 "2-member households") ///
nonumber nomtitle noobs nostar 
drop y

********************************************************************************
*Number of coholders

*Any individual level
eststo a: quietly estpost tabulate coholder if edate_id == 1335
esttab a using "Tables/Coholder.tex", replace ///
collabels("\# Any individuals" \multicolumn{1}{c}{{Percent}} \multicolumn{1}{l}{{Cumulative}}) ///
cells("b(label(Mean) fmt(%15.0fc)) pct(label(Percent) fmt(%15.2fc)) cumpct(label(Cumulative) fmt(%15.2fc))") ///
varlabel(0 "No coholder" 1 "Coholder") ///
nonumber nomtitle noobs nostar 

*Single individual level
eststo a: quietly estpost tabulate coholder if edate_id == 1335 & alwaysin2memberhh==0
esttab a using "Tables/Coholder_S.tex", replace ///
collabels("\# Single individuals" \multicolumn{1}{c}{{Percent}} \multicolumn{1}{l}{{Cumulative}}) ///
cells("b(label(Mean) fmt(%15.0fc)) pct(label(Percent) fmt(%15.2fc)) cumpct(label(Cumulative) fmt(%15.2fc))") ///
varlabel(0 "No coholder" 1 "Coholder") ///
nonumber nomtitle noobs nostar 

*Linked individual level
eststo a: quietly estpost tabulate coholder if edate_id == 1335 & alwaysin2memberhh==1
esttab a using "Tables/Coholder_L.tex", replace ///
collabels("\# Linked individuals" \multicolumn{1}{c}{{Percent}} \multicolumn{1}{l}{{Cumulative}}) ///
cells("b(label(Mean) fmt(%15.0fc)) pct(label(Percent) fmt(%15.2fc)) cumpct(label(Cumulative) fmt(%15.2fc))") ///
varlabel(0 "No coholder" 1 "Coholder") ///
nonumber nomtitle noobs nostar 

*Household level
eststo a: quietly estpost tabulate coholder_HH if hh_edate_obs == 1 & edate_id == 1335
esttab a using "Tables/SummaryHouseholds3.tex", replace ///
collabels( \multicolumn{1}{c}{{\#Households}} \multicolumn{1}{c}{{Percent}} \multicolumn{1}{l}{{Cumulative}}) ///
cells("b(label(Mean) fmt(%15.0fc)) pct(label(Percent) fmt(%15.2fc)) cumpct(label(Cumulative) fmt(%15.2fc))") ///
varlabel(0 "No coholder" 1 "Coholder") ///
nonumber nomtitle noobs nostar 

